home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 68.7z
/
BS1 part 68
/
InterChange Plus v3.0 (1993-11)(Syndesis)(Disk 2 of 2).7z
/
InterChange Plus v3.0 (1993-11)(Syndesis)(Disk 2 of 2).adf
/
PC_Tools.LZH
/
ALISP.ZIP
/
CLRMESH.LSP
< prev
next >
Wrap
Lisp/Scheme
|
1993-10-06
|
3KB
|
74 lines
;******************* CLRMESH.LSP **************************
;************ WRITTEN BY PATRICK McDONALD *****************
;***************** March 18, 1991 *************************
;AUTOLISP STUDENT, BILLINGS VOCATIONAL TECHNICAL CENTER
;CLRMESH will change the colors of 3dfaces depending on their elevation.
;It is very useful when changing colors in a 3D-Mesh representation
;of a land surface.
;It requires a minimum and maximum elevation and if the highest point
;of the 3DFACE falls within this range than the 3DFACES color will be
;changed.
;You may specify the new color by either the color number or the color name.
;
;Your comments and suggestions are appreciated. Compuserve user# 76264,2273
(defun c:clrmesh ()
(setq minr (getdist "\nElevation range minimum: ")
maxr (getdist "\nElevation range maximum: ")
w 1
);close setq
(initget "NAme NUmber")
(setq qu (getkword "\nSpecify color by NUmber or <NAme>: "))
(if (= qu "NUmber")
(setq clrn (getint "\nColor NUMBER for faces within range: "))
(while w
(setq clr (strcase (getstring "\nColor NAME for faces within range: ")))
(setq clrn (cond ((= clr "RED") 1)
((= clr "YELLOW") 2)
((= clr "GREEN") 3)
((= clr "CYAN") 4)
((= clr "BLUE") 5)
((= clr "MAGENTA") 6)
((= clr "WHITE") 7)
((= clr "GREY") 8)
(T nil)
);close cond
);close setq
(if (= clrn nil) (progn (prompt "\nUnsupported color name...")
(prompt "\nBlue, Cyan, Green, Grey, Magenta, Red, White, or Yellow...")
);close progn
(setq w nil)
);close if
);close while/else
);close if
(initget "Select All")
(setq ans (getkword "\n[S]elect individual faces <All>: "))
(if (= ans "Select")
(setq sst (ssget))
);close if
(if (or (= ans nil) (= ans "All"))
(setq sst (ssget "x" (list (cons 0 "3DFACE"))))
);close if
(setq cnt 0)
(repeat (sslength sst)
(setq fac (entget (ssname sst cnt)))
(if (= (cdr (assoc 0 fac)) "3DFACE")
(progn
(setq c1 (cdr (assoc 10 fac))
c2 (cdr (assoc 11 fac))
c3 (cdr (assoc 12 fac))
c4 (cdr (assoc 13 fac))
mxc (max (caddr c1) (caddr c2) (caddr c3) (caddr c4))
);close setq
(if (and (>= mxc minr) (<= mxc maxr))
(if (= (assoc 62 fac) nil)
(entmod (setq fac (append fac (list (cons 62 clrn)))))
(entmod (subst (cons 62 clrn) (assoc 62 fac) fac))
);close if3
);close if2
);close progn
);close if1
(setq cnt (1+ cnt))
);close repeat
);close defun